package com.hzqy.service.epg;


import com.hzqy.persistence.dao.epg.AcSilverDao;
import com.hzqy.web.vo.epg.AcSilverVo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.text.SimpleDateFormat;
import java.util.*;

@Service
public class AcSilverServiceBean {
	protected final Logger LOG = LoggerFactory.getLogger(getClass());
	
	@Resource
	private AcSilverDao acSilverDao;
	/**
	 *  查询一个兑换码
	 * */
	public List<AcSilverVo> selectSilverList(String userId){
		Map<String,Object> map=new HashMap<String,Object>();
		SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		Date d = new Date();
		String today = sdf1.format(d);
		map.put("f_as_cardkey",userId);//userid
		map.put("f_as_udate",today.substring(0,7));//时间
		List<AcSilverVo> silverList = acSilverDao.acSilverInfoList(map);
		LOG.debug("查询所有兑换码信息"+silverList.size()+"信息显示"+silverList);
		return silverList;
	}
}
